package com.jingwei.dao;

import java.util.List;

import net.paoding.rose.jade.annotation.DAO;
import net.paoding.rose.jade.annotation.SQL;
import net.paoding.rose.jade.core.Identity;

import com.jingwei.bean.User;

@DAO
public interface UserDAO {

	@SQL("select id, name, price, author from user where id = :1")
	public User get(long userId);

	@SQL("select name, age from user limit :1")
	public List<User> find(int limit);

	@SQL("select name, age from user where name = :1 limit 1")
	public User findByName(String name);

	@SQL("update book set name=:1.name, price=:1.price, author=:1.author where id=:1.id")
	public void update(User user);

	@SQL("insert into user (name, age) values (:1.name, :1.age)")
	public Identity save(User user);

}